import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, BaseEntity } from 'typeorm';

export enum UserStatusEnum {
    NORMAL = 0,//正常
    ENABLE = 1,//禁用，黑名单
}

//信贷经理用户表
@Entity('crediter_account')
export class CrediterAccount extends BaseEntity {

    @PrimaryGeneratedColumn()
    crediter_id: number;

    @Column({
        width: 10,
        default: 0,
        comment: "羿币"
    })
    coin: number;

    @Column({
        length: 20,
        default: '',
        comment: "姓名"
    })
    name: string;

    @Column({
        width: 5,
        default: 0,
        comment: "性别"
    })
    gender: number;

    @Column({
        length: 20,
        comment: "手机号"
    })
    mobile: string;

    @Column({
        length: 20,
        comment: "身份证号",
        default: ''
    })
    id_no: string;

    @Column({
        length: 100,
        comment: "身份证正面照片地址",
        default: ''
    })
    face_id_card_url: string;

    @Column({
        length: 100,
        comment: "身份证反面照片地址",
        default: ''
    })
    back_id_card_url: string;

    @Column({
        length: 100,
        comment: "手持身份证正面照片地址",
        default: ''
    })
    withdraw_id_card_url: string;

    @Column({
        length: 100,
        comment: "本人与公司logo合照照片",
        default: ''
    })
    with_logo_pic_url: string;

    @Column({
        length: 100,
        comment: "公司营业执照照片",
        default: ''
    })
    business_license_url: string;

    @Column({
        length: 100,
        comment: "公司劳动合同照片地址",
        default: ''
    })
    labor_contract_url: string;

    @Column({
        length: 100,
        comment: "本人工牌或名片",
        default: ''
    })
    work_card: string;

    @Column({
        length: 100,
        comment: "所在城市",
        default: ''
    })
    city: string;

    @Column({
        length: 100,
        comment: "机构名称",
        default: ''
    })
    org_name: string;

    @Column({
        length: 100,
        comment: "机构所在详细地址",
        default: ''
    })
    org_address: string;

    @Column({
        width: 10,
        type: "int",
        default: UserStatusEnum.NORMAL,
        comment: "用户状态"
    })
    status: number;

    @CreateDateColumn({
        comment: "创建时间"
    })
    create_time: Date;

    @UpdateDateColumn({
        comment: "更新时间"
    })
    update_time: Date;

}